<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  props: {
    info: { type: Object, required: true },
  },
});
</script>

<template>
  <view class="goods-item">
    <image class="goods-item-img" :src="info.cover_pic" mode="aspectFill" />
    <view class="goods-item-content">
      <view class="goods-item-name">{{ info.product_name }}</view>
      <view class="goods-item-price">
        ¥{{ info.min_price }}<text class="goods-item-price2">起</text>
      </view>
    </view>
  </view>
</template>

<style lang="scss">
.goods-item {
  border-radius: 24rpx;
  background-color: #ffffff;

  .goods-item-img {
    display: block;
    width: 100%;
    height: 250rpx;
    border-radius: 24rpx 24rpx 0 0;
  }

  .goods-item-content {
    padding: 20rpx;
  }

  .goods-item-name {
    height: 84rpx;
    margin-bottom: 10rpx;
    font-size: 28rpx;
    color: #2d2d2d;
    line-height: 42rpx;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  .goods-item-price {
    font-size: 30rpx;
    color: #fa6400;
    line-height: 42rpx;
    font-weight: bold;
  }

  .goods-item-price2 {
    margin-left: 2rpx;
    font-size: 20rpx;
    color: #666666;
    font-weight: 400;
  }
}
</style>